{{extend '../layout.html'}}

{{block 'content'}}
<div class="main-list">
    <a href="/user/add">
        <button type="button" class="fl-r btn btn-primary btn-lg">新增用户</button>
    </a>

    <div class="main-table">
        <table class="table table-hover table-striped">
            <tr>
                <td>#</td>
                <td>姓名</td>
                <td>性别</td>
                <td>年龄</td>
                <td>生日</td>
                <td>工作</td>
                <td>编辑</td>
            </tr>
            
            {{each userList}}
            <tr>
                <td>{{$index + 1}}</td>
                <td>{{$value.userName}}</td>
                {{if $value.gender === 1}}
                <td>男</td>
                {{else}}
                <td>女</td>
                {{/if}}
                <td>{{$value.age}}</td>
                <td>{{$value.birthday}}</td>
                <td>{{$value.job}}</td>
                <td>
                    <a href="/user/edit?id={{$value._id}}">编辑</a>
                    <a href="/user/delete?id={{$value._id}}">删除</a>
                </td>
            </tr>
            {{/each}}
        
        </table>
    </div>
</div>
{{/block}}